package com.huawei.hms.support.api.pay.json;

import com.huawei.hms.common.ApiException;
import com.huawei.hms.common.internal.ResponseErrorCode;
import com.huawei.hms.common.internal.TaskApiCall;
import com.huawei.hms.support.api.client.Status;
import com.huawei.hms.support.api.entity.pay.HwWalletInoResp;
import com.huawei.hms.support.api.pay.HwWalletInfoResult;
import com.huawei.hms.support.log.HMSLog;
import com.huawei.hms.utils.JsonUtil;
import o.fjx;

public class HwWalletInfoTaskApiCall extends TaskApiCall<PayHmsClient, HwWalletInfoResult> {
    public HwWalletInfoTaskApiCall(String str, String str2) {
        super(str, str2);
    }

    protected void doExecute(PayHmsClient payHmsClient, ResponseErrorCode responseErrorCode, String str, fjx<HwWalletInfoResult> o_fjx_com_huawei_hms_support_api_pay_HwWalletInfoResult) {
        if (responseErrorCode == null) {
            o_fjx_com_huawei_hms_support_api_pay_HwWalletInfoResult.ॱ(new ApiException(new Status(1)));
        } else if (responseErrorCode.getErrorCode() == 0) {
            HMSLog.i("HwWalletInfoTaskApiCall", "onResult, success");
            Object hwWalletInoResp = new HwWalletInoResp();
            JsonUtil.jsonToEntity(str, hwWalletInoResp);
            HwWalletInfoResult hwWalletInfoResult = new HwWalletInfoResult();
            Status status = new Status(responseErrorCode.getStatusCode(), responseErrorCode.getErrorReason());
            hwWalletInfoResult.setStatus(status);
            hwWalletInfoResult.setStatus(status);
            hwWalletInfoResult.setResult(hwWalletInoResp.getResult());
            o_fjx_com_huawei_hms_support_api_pay_HwWalletInfoResult.ॱ(hwWalletInfoResult);
        } else {
            HMSLog.i("HwWalletInfoTaskApiCall", "onResult, returnCode: " + responseErrorCode.getErrorCode());
            o_fjx_com_huawei_hms_support_api_pay_HwWalletInfoResult.ॱ(new ApiException(new Status(responseErrorCode.getErrorCode(), responseErrorCode.getErrorReason())));
        }
    }
}
